﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class xiugai : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void rebt_Click(object sender, EventArgs e)
    {
        string Sql = "Data Source=.;Initial Catalog=smdb;Integrated Security=True";


        using (SqlConnection scon = new SqlConnection(Sql))
        {
           
            string str1 = "update users set psd = '" + xgpswtext.Text + "' where name = '" + Session["username"].ToString()+"'";
            scon.Open();
            SqlCommand command = new SqlCommand
            {
                Connection = scon,
                CommandText = str1
            };
            int obj = command.ExecuteNonQuery();
            scon.Close();
            HttpContext.Current.Response.Redirect("login.aspx");
        }
    }
}